package test.service;

import java.util.Observable;
import java.util.Observer;

import test.domain.User;
/**
 * 观察者
 * @author eqyun
 *
 */
public  class ChatObserver implements Observer{
	
	
	public ChatObserver() {
		super();
	}

	public ChatObserver(User user) {
		super();
		this.user = user;
	}

	private User user;
	
	

	@Override
	public void update(Observable o, Object arg) {
		System.out.println("I konw you do something");
		ChatObservable c = (ChatObservable) o;
		System.out.println("init: "+c.getName() );
		
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
